package com.qf.shop.common.exception;

import com.qf.shop.common.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
@Slf4j
public class TextHtmlExceptionHandler {

    @ExceptionHandler(BusinessException.class)
    public String businessException(BusinessException ex) {
        log.error("出现异常后跳转到视图页面", ex);
        return "error"; // 视图页面
    }

}
